<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
  <HEAD>
    <META name="generator" content=
    "HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net">

    <TITLE>Search Program Text</TITLE>
    <META http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <LINK rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
    <META name="generator" content="Microsoft FrontPage 4.0">
  </HEAD>

  <BODY lang="EN-US">
    <H1><A name="Search_Text"></A>Search Program Text</H1>

    <P>The Search for Program Text feature allows you to search for textual strings within <A href=
    "help/topics/FunctionPlugin/Functions.htm">functions</A>, <A href=
    "help/topics/CommentsPlugin/Comments.htm">comments</A>, <A href=
    "help/topics/LabelMgrPlugin/Labels.htm">labels</A>, <A href=
    "help/topics/Glossary/glossary.htm#Instruction">instructions</A>, and <A href=
    "help/topics/DataPlugin/Data.htm">defined data</A>.&nbsp;&nbsp; You can search incrementally or
    get a list of all of the search results. You can search the entire program, or limit the search
    to your current selection in the Code Browser.</P>

    <P>To bring up the <I>Search Program Text</I> dialog, as shown below, select <B>Search</B><IMG
    src="help/shared/arrow.gif" border="0"><B>Program Text...</B> from the
    tool menu.</P>

	<BR><BR>

    <CENTER>
      <IMG alt="" src="images/SearchText.png" >
    </CENTER>

    <H3>Search Type</H3>

    <BLOCKQUOTE>
      <P>There are two ways that you can search for text:  the <I>Program Database Search</I> and the
      <I>Listing Display Search</I>.</P>

      <P>The <I>Program Database Search</I> option searches the program database, not what you actually see in
      the Code Browser.&nbsp; Conversely, the <I>Listing Display Search</I> searches exactly what you
      see in the Code Browser.  These searches yield different results because the listing includes derived and auto-generated
      information that is not stored in the database and the database can contain information that is not currently displayed, such
      as automatic comments.
      &nbsp; The following table summarizes the pros and cons of using each
      search type:</P>

      <BLOCKQUOTE>

	      <TABLE border="1" width="100%">
	        <TBODY>
	          <TR>
	            <TD align="center" bgcolor="#CCCCFF" width="20%">&nbsp;</TD>
	
	            <TD align="center" bgcolor="#CCCCFF" width="40%"><B><I>Program Database Search</I></B></TD>
	
	            <TD align="center" bgcolor="#CCCCFF" width="25%"><B><I>Listing Display Search</I></B></TD>
	          </TR>
	
	          <TR>
	            <TD width="20%"><B>Advantages</B></TD>
	
	            <TD valign="middle" width="40%"><P>- Faster than the <I>Listing Display Search</I>
	            <P>- Can search information that is not currently being displayed for various reasons 
	            such as listing fields and display options.</I></TD>
	
	            <TD width="25%">
	              <P>- Search Results reflect what you see in the Code Browser Listing window. 
	
	              <P>- Allows a search of all fields that are displayed in the Code Browser, which
	              includes auto generated and derived information that is not stored in the database.</P>
	            </TD>
	          </TR>
	
	          <TR>
	            <TD width="20%"><B>Disadvantages</B></TD>
	
	            <TD width="40%">
				  <P> - Search Results may not match what the Listing displays, since this 
				  search looks at information that is directly stored in the database and not the 
				  derived and enhanced information that is shown in the Listing Display. Searches 
				  are also restricted to specific fields and may not cover all the fields shown 
				  in the Code Browser listing window.
	              
	              <P>- Assumes a specific <A href="#SearchOrder">search order</A> of the fields; you
	              may have rearranged the fields in your Code Browser such that they appear in a
	              different order from the search order; this may cause cursor movement for incremental
	              searches to appear "random" within the content for a single address.</P>
	
	            </TD>
	
	            <TD valign="middle" width="40%"><P>- Can be MUCH slower than a database search.  For example,
	            if you have a large program with one comment, the database search can find a match in that
	            comment instantly, while the listing display search will have to render every address in the
	            program one at a time until it finds a hit.
	            <P>- Does not find information that is currently not displayable by the Listing window.  For 
	            example, comments at offcut locations are not displayed in the browser, so this search would
	            not find them.
	            </TD>
	          </TR>
	        </TBODY>
	      </TABLE>

      </BLOCKQUOTE>

      <P>By default, the <B>Program Database</B> <I>Search Type</I> type is selected.</P>

		<BLOCKQUOTE>
	      <P><IMG src="help/shared/note.png" border="0">If you select the
	      <I>All Fields</I> button, the <B>Listing Display </B> <I>Search Type</I> button automatically becomes
	      selected, as the <I>Search All Fields</I> does not apply to the <B>Program Database</B>. The
	      <I>Selected Fields</I> option applies to either the <B>Program Database</B> or the <B>Listing Display 
	      </B>.</P>
      	</BLOCKQUOTE>
      
    </BLOCKQUOTE>

    <H3>Incremental Search</H3>

    <BLOCKQUOTE>
      <P><A name="IncrementalSearch"></A>To search for text strings incrementally,</P>

      <OL>
        <LI>Select the <B><FONT size="4">Search</FONT></B><IMG src="help/shared/arrow.gif" border=
        "0" ><B><FONT size="4">Program Text</FONT></B> from the Code Browser
        tool menu.</LI>

        <LI>
          In the <I>Search for</I> field, enter the string for which you want to search, using
          wildcards (* or ?) as needed. The * matches any character. The ? matches a single
          character.&nbsp; 

          <UL>
            <LI><IMG src="help/shared/warning.png" border="0"> This field does
            not support <I><A href="help/topics/Glossary/glossary.htm#RegularExpression">regular
            expressions</A></I>.</LI>

            <LI><IMG src="help/shared/tip.png" border="0" > If you need to
            search for one of the wildcard characters, then escape the character with a backslash.
            For example, to search for any occurrence of an asterisk, you would enter <TT>\*</TT>
            as the search string.</LI>

            <LI>Use the combo box next to the <I>Search for</I> field to view the list of search
            strings that you previously entered.</LI>
            
             <LI>
                <IMG src="help/shared/tip.png" border="0" >If you have selected text within 
                a single field, then if you invoke the dialog, it will automatically load that text into the 
                <I>Search for</I> text box for your convenience.
             </LI>
          </UL>
        </LI>

        <LI>
          Select the options for where in the Program to search. 

          <UL>
            <LI>Functions - search function headers, comments, signature, variable types, variable
            names, and comments on variables</LI>

            <LI>Comments - search Plate, Pre-, Post-, End of Line Comments, and Repeatable; by default this check box
            is selected</LI>

            <LI>Labels - search Labels</LI>

            <LI>Instruction Mnemonics - search the Mnemonics of instructions</LI>

            <LI>Instruction Operands - search the Operands of instructions</LI>

            <LI>Defined Data Mnemoncis - search Mnemonics of defined data<BR>
            </LI>

            <LI>Defined Data Values - search Values of defined data<BR>
            </LI>

            <LI>
                <IMG src="help/shared/note.png" border="0" >The <B>Program Database</B> 
                <I>Search Type</I> does not include components of&nbsp; <A href=
                "help/topics/DataPlugin/Data.htm#StructureDefinition">Structures</A> or <A href=
                "help/topics/DataPlugin/Data.htm#UnionDefinition">Unions</A>. Use the 
                <B>Listing Display</B> <I>Search Type</I> for this case. If you do want to
                 search structures or unions, they
                must be open in the Code Browser.
              
            </LI>
            
             <LI style="list-style: none">
              <DIV style="margin-left: 2em">
                <IMG src="help/shared/note.png" border="0" >If you have made a selection and it
                 has been loaded into the <I>Search for</I> text box then the dialog will 
                 automatically select the field that the text was found in as your choice of
                  <I>Field</I> to search. You have the option to add more or remove this selection 
                  if you wish.
              </DIV>
            </LI>
          </UL>
        </LI>

        <LI>Select whether or not to search "Other" memory blocks (blocks that not actually 
        loaded in a running program); <I>Loaded Blocks</I> is selected by default which means
        "Don't search the "Other" blocks.</LI>

        <LI>You can select or deselect the <I>Case Sensitive</I> check box depending on whether you
        want your search to consider case.</LI>

        <LI>If you make a selection in the Code Browser, the <I>Search Selection</I> check box will
        be selected by default. If you do not want the search to be restricted to the selection,
        then deselect the check box.</LI>

        <LI>
          Click on the <B><FONT size="4">Next</FONT></B> or <B><FONT size="4">Previous</FONT></B> button to search
          forwards or backwards in the program, (or from the <I>Search for</I> field,
          press the <B>&lt;Enter&gt;</B> key to search forward). 

          <UL>
            <LI>The start of the search operation begins at your current location in the Code
            Browser.</LI>
          </UL>
        </LI>

        <LI>If a match is found, the current location in the Code Browser is moved to the location
        of the match. If no match is found, then a "Not found" message is displayed in the
        dialog.</LI>

        <LI><A name="Repeat_Text_Search"></A>If you mouse click in the Code Browser to move focus
        there, you can choose <B>Search</B><IMG src="help/shared/arrow.gif" border="0"><B>Repeat Text Search</B> to go to the next match found.</LI>
      </OL>

      <P><IMG src="help/shared/note.png" border="0" >Search operations do not
      "wrap" once the you have reached the maximum address in memory or within a selection. Select
      the <I>Backward</I> direction check box to search backwards from your current location.</P>

      <P><IMG src="help/shared/tip.png" border="0" >For very large Programs
      that may take a while to search, you can cancel your search at any time. For these
      situations, an indicator for "search in progress" is displayed with a <B><FONT size=
      "4">Cancel</FONT></B> button. Click on the <B><FONT size="4">Cancel</FONT></B> button to stop
      the search</P>

      <P><IMG src="help/shared/note.png" border="0" >Dismissing the search
      dialog automatically cancels the search operation. For <A href="#SearchAll">search all</A>,
      partial results are ignored if the search dialog was dismissed while the search was still in
      progress, therefore, the "View Results" question dialog will not be displayed.</P>
    </BLOCKQUOTE>

    <H3><A name="SearchAll"></A>Search All</H3>

    <UL>
      <LI>To find all matches in the Program (or a selection in the program),&nbsp;</LI>
    </UL>

    <BLOCKQUOTE>
      <OL>
        <LI>Follow the Steps 1 through 6 for <A href="#IncrementalSearch">searching
        incrementally</A>. (Skip Step 4 as <I>Direction</I> is irrelevant in this case.)</LI>

        <LI>Click on the <B><FONT size="4">Search All</FONT></B> button.</LI>

        <LI><A name="SearchAllResults"></A>The <I><A href="Query_Results_Dialog.htm">Query
        Results</A></I> display shows all the matches.</LI>
      </OL>
    </BLOCKQUOTE>

    <CENTER>
      <IMG src="images/QueryResultsSearch.png" border="0">
    </CENTER>
    
     <BLOCKQUOTE>
     <P><IMG src="help/shared/tip.png" border="0" >When performing a "Search All" on large Programs,
      the results table will appear before the search is completed.  At the bottom of this window,
      there will be a cancel button that you can use to stop  the search.</P>
    </BLOCKQUOTE>

    <BLOCKQUOTE>
      <P>There may be multiple entries for the same address, depending on what you search for. For
      example, a string may appear multiple times in the same pre-comment, so you will see as many
      entries in the Query Results display. When you click on a row in the <I><A href=
      "Query_Results_Dialog.htm">Query Results</A></I> display, your cursor in the Code Browser is
      moved to that location where the match was found. So, if the match was found in an operand,
      then the location is moved to the matching string within the operand.</P>
    </BLOCKQUOTE>
    
    <H3><A name="SearchLimit"></A>Search Limit Option</H3>
    
    <BLOCKQUOTE>
      <P>The tool has an option to limit the number of search results. The search will stop after
      this number has been exceeded. The below dialog warns you of the partial results. To see more 
      search results, select <B>Edit</B><IMG src="help/shared/arrow.gif" border="0" ><B>Tool 
      Options...</B> from the menu bar, then select the <I>Search</I> node in the tree. Edit the 
      <I>Search Limit</I> field to increase your search limit.</P>
      
      <P align="center"><IMG src="images/SearchLimitExceeded.png" border="0"></P>
    </BLOCKQUOTE>

    <BLOCKQUOTE>
      <P>&nbsp;</P>
    </BLOCKQUOTE>

    <H3><A name="HighlightText"></A>Highlight Search Option</H3>

    <BLOCKQUOTE>
      <P>You can specify that the string found in the search be highlighted by selecting the
      <I>Highlight Search Results</I> checkbox on the Search Options panel. To view the Search
      Options, select <B>Edit</B><IMG src="help/shared/arrow.gif" border="0" ><B>Tool Options...</B> from the tool menu, then select the <I>Search</I> node in the Options
      tree in the Options dialog. You can also change the highlight color. Click on the color bar
      next to <I>Highlight Color</I> to bring up a color chooser. Choose the new color, click on
      the <B>OK</B> button.&nbsp; The option for <I>Highlight Color for Current Match</I> indicates
      the color used to highlight the match when it occurs at the current location in the Code
      Browser.&nbsp; Apply your changes by clicking on the <B>OK</B> or <B>Apply</B> button on the
      Options dialog.</P>
    </BLOCKQUOTE>

    <BLOCKQUOTE>
      <P>The highlight options also apply to <A href="Search_Memory.htm">searching memory</A>.</P>

      <P><IMG src="help/shared/tip.png" border="0">Other notes of interest
      on highlighting:</P>

		<BLOCKQUOTE>
      <UL>
        <LI>Highlights are displayed for the last search that you did. For example, if you bring up
        the Search Memory dialog and search for bytes, that string now becomes the new highlight
        string. Similarly, if you invoke <A href=
        "help/topics/CodeBrowserPlugin/CodeBrowser.htm#cursorTextHighlight">cursor text
        highlighting</A>, that becomes the new highlight string.</LI>

        <LI>Highlights are displayed only for those items that you selected to search.&nbsp; For
        example, you did not select <I>Labels</I> to search but a label matched the string you
        searched for.&nbsp; Thus, the field for that label will not be highlighted.</LI>

        <LI>Highlights are dropped when you close the search dialog, or close the query results
        window for your most recent search.</LI>
      </UL>
      		</BLOCKQUOTE>

    </BLOCKQUOTE>

    <H3><A name="SearchOrder"></A>Default Search Order for <I>Program Database Search</I></H3>

    <BLOCKQUOTE>
      <P>For the <I>Program Database Search</I> option, as you incrementally step, the order in which the
      cursor is positioned at the match in the Listing fields is as follows:</P>
    </BLOCKQUOTE>

	<BLOCKQUOTE>
	    <UL>
	      <LI>Functions</LI>
	
	      <LI>Plate Comments</LI>
	
	      <LI>Pre-Comments</LI>
	
	      <LI>Labels</LI>
	
	      <LI>Instruction Mnemonic</LI>
	
	      <LI>Instruction Operands</LI>
	
	      <LI>Defined Data Mnemonics</LI>
	
	      <LI>Defined Data Values</LI>
	
	      <LI>End of Line Comments</LI>
	
	      <LI>Repeatable Comments</LI>
	
	      <LI>Post Comments</LI>
	    </UL>
    </BLOCKQUOTE>

    <BLOCKQUOTE>
      <P>Within a Function, the order is as follows:</P>
    </BLOCKQUOTE>

	<BLOCKQUOTE>
	    <UL>
	      <LI>Function Comments</LI>
	
	      <LI>Function Signature</LI>
	
	      <LI>Stack Variable Type</LI>
	
	      <LI>Stack Variable Name</LI>
	
	      <LI>Stack Variable Offset</LI>
	
	      <LI>Stack Variable Comment</LI>
	    </UL>
    </BLOCKQUOTE>

    <BLOCKQUOTE>
      <P>The <I><A href="Query_Results_Dialog.htm">Query Results</A></I> display will show the
      search results in this default search order.</P>

      <P><IMG src="help/shared/note.png" border="0"> If your <A href=
      "help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm">Listing fields</A> are
      organized in a different order from the search order (e.g., Plate Comment is after the End of
      Line Comment), then as you search incrementally, your cursor potentially would move back and
      forth at the same address where there are multiple matches all at the same address. In this
      case, the cursor movement may look "random." This is the case only for <I>Program Database Search</I>;
      the <I>Listing Display Search</I> searches in the order of the displayed fields in the Listing.</P>
    </BLOCKQUOTE>

    <P class="providedbyplugin">&nbsp;</P>

    <P class="providedbyplugin">Provided By:&nbsp; <I>TextSearchPlugin</I> &nbsp;</P>

    <P class="relatedtopic">Related Topics:</P>

    <UL>
      <LI>
        <P class="relatedtopic"><A href="Query_Results_Dialog.htm">Query Results</A></P>
      </LI>

      <LI>
        <P class="relatedtopic"><A href="help/topics/DataPlugin/Data.htm">Data</A></P>
      </LI>

      <LI>
        <P class="relatedtopic"><A href=
        "help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm">Listing Fields</A></P>
      </LI>

      <LI>
        <P class="relatedtopic"><A href="Search_Memory.htm">Search Memory</A></P>
      </LI>
    </UL>
  </BODY>
</HTML>
